package gl.vbm

import gl.util.string
import gl.util.unsignedInt
import java.nio.ByteBuffer

class VBMAttribute(buffer: ByteBuffer) {
    val name: String
    val type: Int // uint
    val components: Int // uint
    val flags: Int // uint

    val nameBytes: ByteArray

    init {
        buffer[ByteArray(64).also { nameBytes = it }]
        type = buffer.unsignedInt.toInt()
        components = buffer.unsignedInt.toInt()
        flags = buffer.unsignedInt.toInt()
        name = nameBytes.string()
    }
}